import request from '@/utils/request'

// 获取分销中心数据
export function getDistributionData() {
  return request({
    url: '/distribution/data',
    method: 'get'
  })
}

// 获取团队统计
export function getTeamStats() {
  return request({
    url: '/distribution/team/stats',
    method: 'get'
  })
}

// 获取团队成员列表
export function getTeamMembers(params) {
  return request({
    url: '/distribution/team/members',
    method: 'get',
    params
  })
}

// 获取佣金统计
export function getCommissionStats() {
  return request({
    url: '/distribution/commission/stats',
    method: 'get'
  })
}

// 获取佣金明细
export function getCommissionList(params) {
  return request({
    url: '/distribution/commission/list',
    method: 'get',
    params
  })
}

// 申请佣金提现
export function applyWithdraw(data) {
  return request({
    url: '/distribution/withdraw/apply',
    method: 'post',
    data
  })
}

// 获取提现记录
export function getWithdrawList(params) {
  return request({
    url: '/distribution/withdraw/list',
    method: 'get',
    params
  })
}

// 获取推广素材分类
export function getMaterialCategories() {
  return request({
    url: '/distribution/material/categories',
    method: 'get'
  })
}

// 获取推广素材列表
export function getMaterialList(params) {
  return request({
    url: '/distribution/material/list',
    method: 'get',
    params
  })
}

// 下载推广素材
export function downloadMaterial(id) {
  return request({
    url: `/distribution/material/download/${id}`,
    method: 'get',
    responseType: 'blob'
  })
}

// 获取分销规则
export function getDistributionRules() {
  return request({
    url: '/distribution/rules',
    method: 'get'
  })
}

// 申请成为分销商
export function applyDistributor(data) {
  return request({
    url: '/distribution/apply',
    method: 'post',
    data
  })
}

// 获取分销商等级
export function getDistributorLevel() {
  return request({
    url: '/distribution/level',
    method: 'get'
  })
}

// 获取分销商升级条件
export function getUpgradeConditions() {
  return request({
    url: '/distribution/upgrade/conditions',
    method: 'get'
  })
}

// 获取分销商数据统计
export function getDistributorStats(params) {
  return request({
    url: '/distribution/stats',
    method: 'get',
    params
  })
} 